package com.Servlet;

import com.Service.Impl.UserServiceImpl;
import com.Service.UserService;
import com.entity.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author: 冷俊杰
 * @Description: 查询回收站的用户
 * @DateTime: 2022/6/20 17:42
 **/
@WebServlet(name = "/Recycle", value = "/Recycle")
public class Recycle extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        UserService service = new UserServiceImpl();
        List<User> Recycle = service.SelectUser(0);
        System.out.println("结果" + Recycle);
        request.setAttribute("Recycle", Recycle);
        request.getRequestDispatcher("./Recycle.jsp").forward(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}
